Skip to content

fix(mothership): misc ui bugs#4528

Merged
icecrasher321 merged 2 commits intostagingfrom
fix/nat-lang-comp-check-tool
May 9, 2026
Merged

fix(mothership): misc ui bugs#4528
icecrasher321 merged 2 commits intostagingfrom
fix/nat-lang-comp-check-tool

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Summary

Miscellaneous ui bugs in mothership

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 9, 2026 3:55am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 9, 2026

PR Summary

Medium Risk
Touches core chat streaming/reconnect logic (cursor replay, message reconciliation, tool start suppression), which can impact conversation state and tool execution if edge cases are missed. UI and resource/tool-display tweaks are low risk, but regressions here would be user-visible.

Overview
Fixes several Mothership UX/reconnect edge cases. The plus-menu dropdown now disables the default max-height when showing the root (non-search) menu so it can size to content.

Chat streaming reconnect behavior is hardened by reconciling live assistant turns against persisted messages, selecting whether to replay from cached live state or reset to cursor 0, and avoiding duplicate client workflow tool starts during replay by suppressing only tool-call IDs that already have results; these changes are covered by new use-chat tests.

Resource/tool handling is adjusted by allowing open_resource to open workspace files by file id (no UUID-only constraint), and by making Read tool UI labels more natural for special file paths like content, meta.json, style, and compiled-check (with added tests).

Reviewed by Cursor Bugbot for commit a730c86. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 9, 2026

Greptile Summary

This PR fixes several UI and streaming-reconnect bugs in the mothership/home UI. The changes span the plus-menu dropdown height, stream replay cursor management on reconnect, workspace file open_resource ID handling, and file-read display label formatting.

  • Plus-menu height fix: Adds isRootMenu flag (root, non-search state) and applies max-h-none to prevent the fixed-label dropdown from being clipped by the DropdownMenuContent default max-height.
  • Stream replay rework: Extracts reconcileLiveAssistantTurn, selectReconnectReplayState, and getReplayCompletedWorkflowToolCallIds as standalone testable helpers; replaces the blunt suppressWorkflowToolStarts: boolean with a per-ID suppressedWorkflowToolStartIds: ReadonlySet<string> so only already-completed workflow tool calls are suppressed during replay, and adds cursor/content reconciliation on reconnect to avoid re-rendering stale live content.
  • Non-UUID file IDs: Removes the hard isUuid guard from open_resource file resolution so canonical non-UUID workspace file IDs (e.g. wf_…) are accepted; getWorkspaceFile already queries by exact ID match, so the restriction was unnecessarily tight.

Confidence Score: 4/5

Safe to merge — changes are well-scoped bug fixes with new unit test coverage for the most complex paths.

The streaming reconnect rework in use-chat.ts is the most involved change: it introduces cursor/content reconciliation and per-ID workflow-tool suppression that touches several interlocked refs. The logic appears correct and the new tests cover the key branches, but the overall hook is large and the new callbacks interact with several mutable refs, leaving some risk of subtle edge-case regressions under unusual reconnect sequences. The remaining changes (dropdown height, file ID guard removal, display label formatting) are straightforward and low-risk.

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts — the reconnect path and new applyReconnectReplaySelection callback interact with multiple mutable refs; worth a careful second read.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown.tsx Adds isRootMenu flag and max-h-none override to prevent root dropdown from being height-clipped; clean, minimal change.
apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts Complex reconnect/replay rework: extracts helper functions, replaces boolean suppressWorkflowToolStarts with a per-ID Set, adds cursor/content reconciliation on reconnect; logic is intricate but backed by new unit tests.
apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.test.ts New test file covering reconcileLiveAssistantTurn, selectReconnectReplayState, and getReplayCompletedWorkflowToolCallIds with clear, representative scenarios.
apps/sim/lib/copilot/tools/client/store-utils.ts Adds describeFileReadTarget / describeSpecialFilePathSubject to produce friendlier natural-language labels for workspace file reads; well-tested.
apps/sim/lib/copilot/tools/handlers/resources.ts Removes isUuid guard from open_resource file resolution; getWorkspaceFile queries by exact DB id so the guard was unnecessarily restrictive for canonical non-UUID ids.
apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts JSDoc comment updated to reflect that getWorkspaceFile now accepts any file id, not just UUIDs; no logic changes.

Reviews (1): Last reviewed commit: "fix few more ui/ux bugs" | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit d0b0ede into staging May 9, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/nat-lang-comp-check-tool branch May 9, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant